package com.cms.dao;

import org.springframework.stereotype.Component;

import com.cms.base.HibernateDAOImpl;
import com.cms.entity.Admin;

@Component(value="adminDao")
public class AdminDao extends HibernateDAOImpl<Admin> {

	public Admin login(String username, String password){
		String hql = "select a from Admin a where a.username=:username and a.password = :password ";
		return (Admin)this.getSession().createQuery(hql)
			.setParameter("username", username)
			.setParameter("password", password)
			.uniqueResult();
	}
}
